3.5.54 \(\int \cos ^4(c+d x) (a+b \sec (c+d x)) \, dx\) [454]

Optimal. Leaf size=76 \[ \frac {3 a x}{8}+\frac {b \sin (c+d x)}{d}+\frac {3 a \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {b \sin ^3(c+d x)}{3 d} \]

[Out]

3/8*a*x+b*sin(d*x+c)/d+3/8*a*cos(d*x+c)*sin(d*x+c)/d+1/4*a*cos(d*x+c)^3*sin(d*x+c)/d-1/3*b*sin(d*x+c)^3/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {3872, 2715, 8, 2713} \begin {gather*} \frac {a \sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {3 a \sin (c+d x) \cos (c+d x)}{8 d}+\frac {3 a x}{8}-\frac {b \sin ^3(c+d x)}{3 d}+\frac {b \sin (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^4*(a + b*Sec[c + d*x]),x]

[Out]

(3*a*x)/8 + (b*Sin[c + d*x])/d + (3*a*Cos[c + d*x]*Sin[c + d*x])/(8*d) + (a*Cos[c + d*x]^3*Sin[c + d*x])/(4*d)
 - (b*Sin[c + d*x]^3)/(3*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2713

Int[sin[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[Expand[(1 - x^2)^((n - 1)/2), x], x], x
, Cos[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[(n - 1)/2, 0]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rule 3872

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Dist[a, Int[(d*
Csc[e + f*x])^n, x], x] + Dist[b/d, Int[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]

Rubi steps

\begin {align*} \int \cos ^4(c+d x) (a+b \sec (c+d x)) \, dx &=a \int \cos ^4(c+d x) \, dx+b \int \cos ^3(c+d x) \, dx\\ &=\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}+\frac {1}{4} (3 a) \int \cos ^2(c+d x) \, dx-\frac {b \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}\\ &=\frac {b \sin (c+d x)}{d}+\frac {3 a \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {b \sin ^3(c+d x)}{3 d}+\frac {1}{8} (3 a) \int 1 \, dx\\ &=\frac {3 a x}{8}+\frac {b \sin (c+d x)}{d}+\frac {3 a \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a \cos ^3(c+d x) \sin (c+d x)}{4 d}-\frac {b \sin ^3(c+d x)}{3 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.14, size = 73, normalized size = 0.96 \begin {gather*} \frac {3 a (c+d x)}{8 d}+\frac {b \sin (c+d x)}{d}-\frac {b \sin ^3(c+d x)}{3 d}+\frac {a \sin (2 (c+d x))}{4 d}+\frac {a \sin (4 (c+d x))}{32 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^4*(a + b*Sec[c + d*x]),x]

[Out]

(3*a*(c + d*x))/(8*d) + (b*Sin[c + d*x])/d - (b*Sin[c + d*x]^3)/(3*d) + (a*Sin[2*(c + d*x)])/(4*d) + (a*Sin[4*
(c + d*x)])/(32*d)

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 60, normalized size = 0.79

method result size
derivativedivides \(\frac {a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(60\)
default \(\frac {a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+\frac {b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}}{d}\) \(60\)
risch \(\frac {3 a x}{8}+\frac {3 b \sin \left (d x +c \right )}{4 d}+\frac {a \sin \left (4 d x +4 c \right )}{32 d}+\frac {b \sin \left (3 d x +3 c \right )}{12 d}+\frac {a \sin \left (2 d x +2 c \right )}{4 d}\) \(63\)
norman \(\frac {\frac {3 a x}{8}+\frac {3 a x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {9 a x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {3 a x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\frac {3 a x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8}-\frac {\left (5 a -8 b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (5 a +8 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (9 a -40 b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {\left (9 a +40 b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}\) \(172\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^4*(a+b*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(1/4*(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)+3/8*d*x+3/8*c)+1/3*b*(2+cos(d*x+c)^2)*sin(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 57, normalized size = 0.75 \begin {gather*} \frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a - 32 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} b}{96 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/96*(3*(12*d*x + 12*c + sin(4*d*x + 4*c) + 8*sin(2*d*x + 2*c))*a - 32*(sin(d*x + c)^3 - 3*sin(d*x + c))*b)/d

________________________________________________________________________________________

Fricas [A]
time = 3.00, size = 53, normalized size = 0.70 \begin {gather*} \frac {9 \, a d x + {\left (6 \, a \cos \left (d x + c\right )^{3} + 8 \, b \cos \left (d x + c\right )^{2} + 9 \, a \cos \left (d x + c\right ) + 16 \, b\right )} \sin \left (d x + c\right )}{24 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/24*(9*a*d*x + (6*a*cos(d*x + c)^3 + 8*b*cos(d*x + c)^2 + 9*a*cos(d*x + c) + 16*b)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right ) \cos ^{4}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**4*(a+b*sec(d*x+c)),x)

[Out]

Integral((a + b*sec(c + d*x))*cos(c + d*x)**4, x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 140 vs. \(2 (68) = 136\).
time = 0.44, size = 140, normalized size = 1.84 \begin {gather*} \frac {9 \, {\left (d x + c\right )} a - \frac {2 \, {\left (15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^4*(a+b*sec(d*x+c)),x, algorithm="giac")

[Out]

1/24*(9*(d*x + c)*a - 2*(15*a*tan(1/2*d*x + 1/2*c)^7 - 24*b*tan(1/2*d*x + 1/2*c)^7 - 9*a*tan(1/2*d*x + 1/2*c)^
5 - 40*b*tan(1/2*d*x + 1/2*c)^5 + 9*a*tan(1/2*d*x + 1/2*c)^3 - 40*b*tan(1/2*d*x + 1/2*c)^3 - 15*a*tan(1/2*d*x
+ 1/2*c) - 24*b*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 1)^4)/d

________________________________________________________________________________________

Mupad [B]
time = 0.83, size = 75, normalized size = 0.99 \begin {gather*} \frac {3\,a\,x}{8}+\frac {2\,b\,\sin \left (c+d\,x\right )}{3\,d}+\frac {3\,a\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{8\,d}+\frac {a\,{\cos \left (c+d\,x\right )}^3\,\sin \left (c+d\,x\right )}{4\,d}+\frac {b\,{\cos \left (c+d\,x\right )}^2\,\sin \left (c+d\,x\right )}{3\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^4*(a + b/cos(c + d*x)),x)

[Out]

(3*a*x)/8 + (2*b*sin(c + d*x))/(3*d) + (3*a*cos(c + d*x)*sin(c + d*x))/(8*d) + (a*cos(c + d*x)^3*sin(c + d*x))
/(4*d) + (b*cos(c + d*x)^2*sin(c + d*x))/(3*d)

________________________________________________________________________________________